package com.example.sys.job.listener;

import org.quartz.JobExecutionContext;
import org.quartz.Trigger;
import org.quartz.TriggerListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class JobLogTriggerListener implements TriggerListener {

    Logger logger = LoggerFactory.getLogger(getClass());

    @Override
    public String getName() {
        return getClass().getSimpleName();
    }


    /*****
     * job即将被运行
     * @param trigger
     * @param jobExecutionContext
     */
    @Override
    public void triggerFired(Trigger trigger, JobExecutionContext jobExecutionContext) {

    }


    @Override
    public boolean vetoJobExecution(Trigger trigger, JobExecutionContext jobExecutionContext) {
        return false;
    }

    /***
     * 任务错过时候触发
     * @param trigger
     */
    @Override
    public void triggerMisfired(Trigger trigger) {

    }

    /****
     * 任务完成时触发
     * @param trigger
     * @param context
     * @param completedExecutionInstruction
     */
    @Override
    public void triggerComplete(Trigger trigger, JobExecutionContext jobExecutionContext, Trigger.CompletedExecutionInstruction completedExecutionInstruction) {

    }
}
